//先创建一个文件夹， 然后在使用fs.rename方法来改名
const fs = require("fs");
const path = require("path");

let filePath = path.join(__dirname , process.argv[2]);

let newPath = path.join(__dirname , "filedir/new.txt");
fs.writeFileSync(filePath , "dwhasidad");
fs.renameSync(filePath , newPath);
// console.log(fs.statSync(filePath));